<?php
	
	if(!@$_POST['akses'] == true) {
	   die('Akses langsung tidak diperbolehkan!');
	}
    
    include("dboper.php");

    $myhash = md5_file($_FILES['txtFoto']['tmp_name']);

    $nama = $_POST['txtNama'];
    $nim = $_POST['txtNIM'];
    $namaPanggilan = $_POST['txtPanggilan'];
    $namaFoto = $myhash."-".$_FILES['txtFoto']['name'];

    sendAsisten($nama,$namaPanggilan,$nim,$namaFoto);
    copy($_FILES['txtFoto']['tmp_name'],"../imagedata/".$namaFoto);

?>
<script>
    alert('Data sukses ditambahkan');
    window.location.href = "./cp.php";
</script>